# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureValueDestination do
  @moduledoc """
  A destination location for Feature values and format.

  ## Attributes

  *   `bigqueryDestination` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQueryDestination.t`, *default:* `nil`) - Output in BigQuery format. BigQueryDestination.output_uri in FeatureValueDestination.bigquery_destination must refer to a table.
  *   `csvDestination` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CsvDestination.t`, *default:* `nil`) - Output in CSV format. Array Feature value types are not allowed in CSV format.
  *   `tfrecordDestination` (*type:* `GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TFRecordDestination.t`, *default:* `nil`) - Output in TFRecord format. Below are the mapping from Feature value type in Featurestore to Feature value type in TFRecord: Value type in Featurestore | Value type in TFRecord DOUBLE, DOUBLE_ARRAY | FLOAT_LIST INT64, INT64_ARRAY | INT64_LIST STRING, STRING_ARRAY, BYTES | BYTES_LIST true -> byte_string("true"), false -> byte_string("false") BOOL, BOOL_ARRAY (true, false) | BYTES_LIST
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :bigqueryDestination =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQueryDestination.t() | nil,
          :csvDestination =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CsvDestination.t() | nil,
          :tfrecordDestination =>
            GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TFRecordDestination.t() | nil
        }

  field(:bigqueryDestination,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1BigQueryDestination
  )

  field(:csvDestination, as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1CsvDestination)

  field(:tfrecordDestination,
    as: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1TFRecordDestination
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureValueDestination do
  def decode(value, options) do
    GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureValueDestination.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AIPlatform.V1.Model.GoogleCloudAiplatformV1FeatureValueDestination do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
